package com.github.niefy.modules.third.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.github.niefy.common.utils.Json;
import lombok.Builder;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 第三方用户基本信息
 */
@Data
@Builder
@TableName("third_user")
public class ThirdUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.INPUT)
    private String thirdId;

    @TableField(value = "open_id", insertStrategy = FieldStrategy.NOT_EMPTY,
            updateStrategy = FieldStrategy.NOT_EMPTY)
    @NotBlank
    private String openId;

    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY)
    private String appId;

    /**
     * 用户名称
     */
    @NotBlank
    private String userName;

    /**
     * 角色ID
     */
    @NotBlank
    private String roleId;

    /**
     * 角色名
     */
    @NotBlank
    private String roleName;

    /**
     * 系号
     */
    @NotBlank
    private String departNo;

    /**
     * 系名称
     */
    @NotBlank
    private String departName;

    /**
     *
     */
    private String consuserId;
    private LocalDateTime updateTime;


    @Override
    public String toString() {
        return Json.toJsonString(this);
    }
}
